Macromedia Flex Article

Learning Flex Basics (Part 3) : Working with Containers


Table of Contents

  1. Introduction
  2. Building the Containers
  3. Create the Application Object
  4. Create a Data Array
  5. Add a TabNavigator Container for Global Navigation
  6. Add an HBox and Panel Containers for Main Views
  7. Add a ViewStack, LinkBar, and Panel Containers for Secondary Views
  8. Add a Form Container
  9. Add a Tile Layout Container and Populate It Using a Repeater
  10. Create a Pseudo Bar Chart Using a Repeater and VBoxes
  11. Complete Code Listing for containers.mxml
  12. Where to Go from Here

Create a Data Array

In the first tutorial you learn how to create an Array using tag syntax. Here you create one in ActionScript.

  1. Inside the Application block, Script block with a CDATA wrapper to prevent the XML parser from trying to interpret the script as XML code:

    <mx:Script>
    	  <![CDATA[]]>
    </mx:Script>
    
  2. Inside the Script block, declare a variable called myArray of type Array, and set the values of the array items as [0,1,2,3,4,5,6,7,8,9]:

    var myArray=[0,1,2,3,4,5,6,7,8,9];